#include<iostream>

using namespace std;
int main(){
int x=1;

int n;

cin>>n;

int **a=new int *[n];
for(int i=0;i<n;i++){
    a[i]=new int[n];
}
for(int i=0;i<n;i++){
	for(int j=i;j<n;j++){
		a[i][j]=x++;
		a[j][i]=a[i][j];
	}
}
for(int i=0;i<n;i++){
	for(int j=0;j<n;j++){
		
		if(j==n-1)
			
			cout<<a[i][j]<<endl;
		else
		cout<<a[i][j];
	}
}
for(int i = 0;i < n;i++)  
    {  
        delete a[i];  
        a[i] = NULL;  
    }  
    delete [n]a;  
    a = NULL;     
  
    return 0;  

}